import com.tiem_files.dao.UserDao;
import com.tiem_files.model.User;
import com.tiem_files.service.UserService;
import com.tiem_files.service.impl.UserServiceImpl;
import org.junit.BeforeClass;
import org.junit.Test;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class Tese {
    private static UserService userService;
@BeforeClass
public static void init(){
    userService=new UserServiceImpl();
}
    @Test
    public void me3(){
        User user =new User();
        user.setEmail("1111@ww.com");
        user.setUsername("erweqr");
        user.setPassword("admin");
        boolean add  = userService.addUser(user);
        if (add){
            System.out.println("添加成功");
        }else {
            System.out.println("添加失败");
        }

    }

    @Test
    public void me4(){
        UserDao userDao= new UserDao();
        List<User> users = userDao.findByCol("username","admin");
        User user = users.get(0);
        System.out.println(user.getEmail());
    }
    @Test
    public void me5(){
    boolean b=userService.resetPassword("zijun1024@aliyun.com","11111");
    if (b){
        System.out.println("成功");
    }else {
        System.out.println("失败");
    }
    }
}
